home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: HELP! #include <math.c> question
- Date: 20 Jan 1996 15:18 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <20JAN199615183742@erich.triumf.ca>
- References: <Pine.SV4.3.91.960120135347.12016A-100000@larry>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <Pine.SV4.3.91.960120135347.12016A-100000@larry>, John Marsh <libjrm@emory.edu> writes...
- >Hi folks-
- >
- >I'm trying to learn C, and have encountered a problem compiling a
- >bit of code. I've tried it on two GNU compilers at different locations,
- >and gotten the same error message. My code looks like this:
-
- <...snippage...>
-
- >When I try to compile it, I get an "Undefined symbol (sqrt) - Symbol
- >referencing error" message. Shouldn't <math.h> recognize sqrt? I must be
- >missing something, obviously, but I'm at a loss... Any help would be
-
- math.h just tells the _compiler_ what the math functions look like. It doesn't
- tell the compiler where to find them.
-
- For most unix systems, the math functions are in a separate library that you
- must explicitly list on the linker or compiler command line. Just add "-lm" to
- the end of your present command.
-
- (This problem doesn't occur in MS-DOS, where allmost all functions are in one
- library...)
-
-
-
-
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-